package com.langfeiyes.pattern.decorator;

import org.apache.coyote.http11.filters.BufferedInputFilter;

import java.io.*;

public class App {
    public static void main(String[] args) throws IOException {
        //大宝剑
        ISword sword = new BigSword();
        System.out.println("名称：" + sword.desc());
        System.out.println("攻击值：" + sword.attackValue());

        System.out.println("---------开始装饰---------");
        sword = new GoldCrystalDecorator(sword);    //金
        sword = new WoodCrystalDecorator(sword);    //木
        sword = new WaterCrystalDecorator(sword);   //水
        sword = new SoilCrystalDecorator(sword);    //火
        sword = new FireCrystalDecorator(sword);    //土

        System.out.println("名称：" + sword.desc());
        System.out.println("攻击值：" + sword.attackValue());


        File file = new File("c:/aa.txt");
        FileInputStream fin = new FileInputStream(file);
        DataInputStream din = new DataInputStream(fin);
        BufferedInputStream bin = new BufferedInputStream(din);
        bin.read();





    }
}
